<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>绘制二次方贝塞尔曲线</title>
    <link rel="stylesheet" href="../../1-Html/global.css">
    <style>
        #canvas {
            display: block;
            margin: 50px auto;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <canvas id="canvas" width="400" height="400"></canvas>

    <div class="learn">
        <h1>总结</h1>
            <h2>quadraticCurveTo()函数的运用</h2>
                <ul>
                    <li>前2个参数：表示切点</li>
                    <li>后2个参数: 表示终点</li>
                </ul>
    </div>
</body>
<script>

let canvas = document.getElementById('canvas');
let context = canvas.getContext('2d');          // 得到2d的画笔

// 绘制方法一
context.fillStyle = '#b2b4b6'; 
context.beginPath();
context.moveTo(0, 200);           // 定义开始的起点             
context.quadraticCurveTo(100, 0, 400, 200);         
context.stroke();


// 画图说明二次方贝塞尔曲线的验证
context.beginPath();
context.moveTo(0, 200);
context.lineTo(100, 0);
context.lineTo(400, 200);
context.stroke();

</script>
</html>